Make High-Level-Rest-Client tests allow deprecation warning temporarily, during deprecation of request parameter 'master_timeout'#2702
Conversation
Signed-off-by: Tianli Feng <ftianli@amazon.com>
| import static org.hamcrest.Matchers.lessThan; | ||
| import static org.hamcrest.Matchers.notNullValue; | ||
|
|
||
| @LuceneTestCase.AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/pull/2683") |
There was a problem hiding this comment.
Thank you for raising this PR.
I have one concern that muting test classes has potential of introducing bugs from other code changes exercising these two test classes. How do we have plan to cover this ?
There was a problem hiding this comment.
Hi @dreamer-89 thank you for reviewing my PR.
My thought is to hold merging this PR until all the other PRs are ready to be merged in #2511. When getting ready, then merging all those PRs together in a short time. The potential of other code changes merged can be reduced by try to shorten the interval of muting the tests.
This is a good point, I should put up some notice saying not to merge this PR in a hurry. 😄
There was a problem hiding this comment.
Thanks @tlfeng for clarifying.
Is it possible we can add OpenSearchRestTestCase.expectWarnings in tests in above two tests files wherever we are adding master_timeout. I think this is how we are tackling other deprecated features on client side.
There was a problem hiding this comment.
Thank you for your good suggestion!
You are right. 👍 Looks like I should turn off the enableWarningsCheck https://github.com/opensearch-project/OpenSearch/blob/1.3.1/test/framework/src/main/java/org/opensearch/test/OpenSearchTestCase.java#L407 for the affected test classes.
There are 24 classes extends this class OpenSearchRestHighLevelClientTestCase (and one class has turned it off https://github.com/opensearch-project/OpenSearch/blob/1.3.1/client/rest-high-level/src/test/java/org/opensearch/client/BulkProcessorIT.java#L89) so the amount of work is reasonable.
I will apply it to the affected test classes.
There was a problem hiding this comment.
Updated the code. The enableWarningsCheck doesn't work for this case, but instead, I found using setStrictDeprecationMode(false) to build the RestClient can make the test allow deprecation warnings. This will be a safer way 😄.
…cation warning in HLRC tests Signed-off-by: Tianli Feng <ftianli@amazon.com>
a88317b to
673e55b
Compare
nknize
left a comment
There was a problem hiding this comment.
LGTM...hopefully this won't stay in flight too long.
…, during deprecation of request parameter 'master_timeout' (#2702) Temporarily build rest client with setStrictDeprecationMode(false) to allow deprecation warning in HLRC tests while master_timeout parameters is being refactored. Signed-off-by: Tianli Feng <ftianli@amazon.com> (cherry picked from commit 6a2a33d)
…, during deprecation of request parameter 'master_timeout' (#2702) Temporarily build rest client with setStrictDeprecationMode(false) to allow deprecation warning in HLRC tests while master_timeout parameters is being refactored. Signed-off-by: Tianli Feng <ftianli@amazon.com> (cherry picked from commit 6a2a33d)
…, during deprecation of request parameter 'master_timeout' (#2702) (#2740) Temporarily build rest client with setStrictDeprecationMode(false) to allow deprecation warning in HLRC tests while master_timeout parameters is being refactored. Signed-off-by: Tianli Feng <ftianli@amazon.com> (cherry picked from commit 6a2a33d)
…, during deprecation of request parameter 'master_timeout' (#2702) (#2741) Temporarily build rest client with setStrictDeprecationMode(false) to allow deprecation warning in HLRC tests while master_timeout parameters is being refactored. Signed-off-by: Tianli Feng <ftianli@amazon.com> (cherry picked from commit 6a2a33d)
…emporarily, during deprecation of request parameter 'master_timeout' (opensearch-project#2702)" This reverts commit 6a2a33d. Signed-off-by: Tianli Feng <ftianli@amazon.com>
…emporarily, during deprecation of request parameter 'master_timeout' (opensearch-project#2702)" This reverts commit 6a2a33d. Signed-off-by: Tianli Feng <ftianli@amazon.com>
…emporarily, during deprecation of request parameter 'master_timeout' (#2702)" (#2744) This reverts commit 6a2a33d. During the process of deprecating REST API request parameter master_timeout and adding alternative parameter cluster_manager_timeout, I made High-Level-Rest-Client tests allow deprecation warning temporarily, by changing the argument of `setStrictDeprecationMode()` to false when building `RestClient` for tests, in the above commit / PR #2702, This PR sets the High-Level-Rest-Client tests back to treating warning header as a failure. Signed-off-by: Tianli Feng <ftianli@amazon.com>
Description
Change:
setStrictDeprecationMode()tofalsewhen building RestClient for tests.Reason:
Many High-Level-Rest-Client tests are broken due to deprecation warning, during the process of deprecating
master_timeoutparameter of REST APIs.The simplest solution is:
falseto make tests allow deprecation warning.cluster_manager_timeoutfor all applicable REST APIscluster_manager_timeoutinstead ofmaster_timeoutin High-Level-Rest-ClientRequestConverterclasstrueNote:
WarningFailureExceptionprovides the way to allow warnings in the RestClient tests.A Sample test failure
Issues Resolved
A part of issue #2511
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.